Add ignored test for empty FileInfo crash
authorFelix Krull <f_krull@gmx.de>
Fri, 24 May 2019 23:08:18 +0000 (01:08 +0200)
committerColin Walters <walters@verbum.org>
Fri, 6 May 2022 16:53:54 +0000 (12:53 -0400)
rust-bindings/rust/src/lib.rs
rust-bindings/rust/tests/repo.rs

index 7fb6f836327f153678dccf1f881f841b08cda6b0..ba306f5fe365b6940741ed0a40b8f812ac19d5b4 100644 (file)
@@ -1,3 +1,9 @@
+//! # Rust bindings for [libostree](https://ostree.readthedocs.io)
+//!
+//! libostree is both a shared library and suite of command line tools that combines
+//! a "git-like" model for committing and downloading bootable filesystem trees,
+//! along with a layer for deploying them and managing the bootloader configuration.
+
 #![doc(html_root_url = "https://fkrull.gitlab.io/ostree-rs")]
 
 extern crate gio_sys;
index 7f8a7d119f63984c04bc0a32ba0d40313c6cadf9..a4049ba063640ae7337d359af3c87371bd7160f8 100644 (file)
@@ -99,3 +99,29 @@ fn should_checkout_tree() {
     let testfile_contents = std::fs::read_to_string(testfile_path).expect("test file");
     assert_eq!("test\n", testfile_contents);
 }
+
+// TODO: figure this out and turn it back on
+#[test]
+#[ignore]
+fn should_error_safely_when_passing_empty_file_info_to_checkout_tree() {
+    let test_repo = TestRepo::new();
+    let _ = test_repo.test_commit("test");
+
+    let file = test_repo
+        .repo
+        .read_commit("test", NONE_CANCELLABLE)
+        .expect("read commit")
+        .0
+        .downcast::<ostree::RepoFile>()
+        .expect("RepoFile");
+    let result = test_repo.repo.checkout_tree(
+        ostree::RepoCheckoutMode::User,
+        ostree::RepoCheckoutOverwriteMode::None,
+        &gio::File::new_for_path("/"),
+        &file,
+        &gio::FileInfo::new(),
+        NONE_CANCELLABLE,
+    );
+
+    assert!(result.is_err());
+}